<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>product</title>
        <!-- 记得要写成 /css/public/header.css -->
        <!-- css/public/header.css 前边有个斜杠，说明是相对于根目录的 -->
        <link rel="stylesheet" href="/css/public/header.css">
        <link rel="stylesheet" href="/css/public/prolist.css">
        <link rel="stylesheet" href="/css/productadd.css">
        <link rel="stylesheet" href="/bootstrap-4.3.1-dist/css/bootstrap.min.css">
        <script src="/js/jquery-3.3.1.min.js"></script>
        <script src="/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>
    </head>
    <body>
        <%- include public/header.html %>
        <div class="main-content">
            <%- include public/prolist.html %>
            <div class="product-page">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">商品管理</a></li>
                        <li class="breadcrumb-item active" aria-current="page">编辑商品</li>
                    </ol>
                </nav>
                <div class="card mb-3" style="width: 100%;">
                    <div class="card-header">增加商品</div>
                    <ul class="list-group list-group-flush">
                        <li class="list-group-item">
                            <form action="/product/doProductEdit" enctype="multipart/form-data" method="post">
                                <!-- 可以使用 display:none 来隐藏 -->
                                <div class="form-group row" style="display:none;">
                                    <label for="number" class="col-1 col-form-label">商品编号</label>
                                    <!-- 在 input 中，可以使用 type=hidden 来隐藏 input 标签 -->
                                    <input type="text" class="form-control-plaintext col-6" id="number" name="number" value="<%= item._id %>">
                                </div>
                                <div class="form-group row">
                                    <label for="proName" class="col-1 col-form-label">商品名称</label>
                                    <input type="text" class="form-control col-6" id="proName" name="proName" value="<%= item.proName %>">
                                </div>
                                <div class="form-group row">
                                    <label for="proImg" class="col-1 col-form-label">商品图片</label>
                                    <input type="file" id="proImg" class="col-6 form-control-plaintext" name="proImg" value="<%= item.proImg %>"><br>
                                </div>
                                <div class="form-group row">
                                    <label for="preview" class="col-1 col-form-label">图片预览</label>
                                    <img src="<%= item.proImg %>" id="preview" width="200" height="200" alt="/<%= item.proName %>">
                                </div>
                                <div class="form-group row">
                                    <label for="procost" class="col-1 col-form-label">商品价格</label>
                                    <input type="text" id="procost" class="form-control col-6" name="procost" value="<%= item.procost %>">
                                </div>
                                <div class="form-group row">
                                    <label for="propostage" class="col-1 col-form-label">商品邮费</label>
                                    <input type="text" id="propostage" class="form-control col-6" name="propostage" value="<%= item.propostage %>">
                                </div>
                                <div class="form-group row">
                                    <label for="prodes" class="col-1 col-form-label">商品描述</label>
                                    <!-- 注意：input是单标签，有value值可以设置，但是 textarea是双标签，没有value值，直接在内部输出 -->
                                    <textarea id="prodes" class="form-control col-6" rows="3" name="prodes"><%= item.prodes %></textarea>
                                </div>
                                <input type="submit" class="btn btn-primary" value="提交">
                            </form>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </body>
</html>